<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function sub(){
				let num1 = document.getElementById("num1").value
				let num2 = document.getElementById("num2").value
				let num3 = num1-num2
				document.getElementById("ans").value=num3.toFixed(15)
			}
			function and(){
				let num1 = document.getElementById("num1").value
				let num2 = document.getElementById("num2").value
				let ans = Number(num1)+Number(num2)
				document.getElementById("ans").value=ans.toFixed(15)
			}
			function div(){
				let num1 = document.getElementById("num1").value
				let num2 = document.getElementById("num2").value
				let ans = num1 / num2
				document.getElementById("ans").value=ans
			}
			function mul(){
				let num1 = document.getElementById("num1").value
				let num2 = document.getElementById("num2").value
				let ans = num1 * num2
				document.getElementById("ans").value=ans
			}
		</script>
	</head>
	<body>
		第一个数：<input type="text"  id="num1" /><br>
		第二个数：<input type="text"  id="num2" /><br>
		<button onclick="and()">+</button>
		<button onclick="sub()" >-</button>
		<button onclick="mul()">*</button>
		<button onclick="div()">/</button><br>
		计算结果：<input type="text"  id="ans" /><br>
		
	</body>
</html>
